package com.turtle3d.user.grammars;

import com.turtle3d.formallanguage.grammar.Grammar;
import com.turtle3d.formallanguage.parser.SimpleParser;
import com.turtle3d.formallanguage.symbol.SymbolFactory;

public class SierpinskiTriangle2D extends Grammar
{

	@Override
	public void define()
	{
		/**
		 * #Sierpinski{
			axiom X;
			angle 60;
			F: FF;
			X: --FXF++FXF++FXF--;
			}
		 */
		
		setAxiom(SimpleParser.parseSymbolSequence("X"));		
		addProduction(SimpleParser.parseProduction("F->FF"));
		addProduction(SimpleParser.parseProduction("X->--FXF++FXF++FXF--"));

	}
	
	public void setRequiredParameters(){
		setRequiredParameter("turnAngle", 60f);		
	}

}
